<%@page import="com.situ.student.entity.Kecheng"%>
<%@page import="com.situ.student.entity.PageBean2"%>
<%@page import="com.situ.student.dao.IStudentDao"%>
<%@page import="com.situ.student.entity.Student"%>
<%@page import="java.util.List"%>
<%@page import="com.situ.student.service.impl.StudentServiceImpl"%>
<%@page import="com.situ.student.service.IStudentService"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="lib/bootstrap-3.3.7-dist/css/bootstrap.css"/>
		</head>
	<body>
		<%
			List<Kecheng> list = (List<Kecheng>)request.getAttribute("list");
		%>
		<%
			System.out.println(list);
		%>
		<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
		
		
		
		
		<!--导航栏开始 -->
			<nav class="navbar navbar-default">
			  <div class="container">
			    <!-- Brand and toggle get grouped for better mobile display -->
			    <div class="navbar-header">
			      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
			        <span class="sr-only">Toggle navigation</span>
			        <span class="icon-bar"></span>
			        <span class="icon-bar"></span>
			        <span class="icon-bar"></span>
			      </button>
			      <a class="navbar-brand" href="#">教务管理系统</a>
			    </div>
			
			    <!-- Collect the nav links, forms, and other content for toggling -->
			    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
			      <ul class="nav navbar-nav">
			      <!-- class="active"  使当前选中高亮 -->
			        <li><a href="/Java823Web/student?method=pageList"><span class="glyphicon glyphicon-user" aria-hidden="true"></span> 学生管理 <span class="sr-only">(current)</span></a></li>
			        <li><a href="/Java823Web/BanjiServlet?method=pageList"><span class="glyphicon glyphicon-home" aria-hidden="true"></span> 班级管理</a></li>
			        <li class="active"><a href="/Java823Web/kecheng?method=list"><span class="glyphicon glyphicon-list-alt" aria-hidden="true"></span> 课程管理</a></li>
			        <li><a href="#"><span class="glyphicon glyphicon-tag" aria-hidden="true"></span> 教务管理</a></li>
			        <li><a href="#"><span class="glyphicon glyphicon-th-large" aria-hidden="true"></span> 在线管理员</a></li>
			      </ul>
			      <ul class="nav navbar-nav navbar-right">
			        <li><a href=""><span class="glyphicon glyphicon-off" aria-hidden="true"></span> 退出</a></li>
			        <!-- Java823Web/session>method=logout -->
			      </ul>
			    </div><!-- /.navbar-collapse -->
			  </div><!-- /.container-fluid -->
			</nav>
		<!--导航栏结束 -->
		<!--正文开始-->
		<div class="container">
			<div class="row">
				<!--左侧导航栏开始  -->
				<div class="col-md-2">
					<div class="list-group">
					  <a href="#" class="list-group-item active">
					   	课程列表
					  </a>
					  <a href="kecheng_html_add.jsp" class="list-group-item">课程添加</a>
					</div>
				</div>
				<!--左侧导航栏结束 -->
				<!--右侧数据栏开始 -->
				<div class="col-md-10">
				<form action="" id="mainForm" method="post">
					<table class="table table-striped">
						<tr>
							<td>id</td>
							<td>课程名</td>
							<td>学分</td>
							<td>修改</td>
							<td>删除</td>
						</tr>
				<% 
					for(Kecheng kecheng:list) {
				%>
					<tr>
						<td><%=kecheng.getId() %></td>
						<td><%=kecheng.getKechengname() %> </td>
						<td><%=kecheng.getXuefen() %> </td>
						<td><a href="${pageContext.request.contextPath}/kecheng?method=toupdate&id=<%=kecheng.getId()%>">修改</a></td>
						<td><a href="${pageContext.request.contextPath}/kecheng?method=deleteById&id=<%=kecheng.getId()%>">删除</a></td>
					</tr>
							
				<%
					}
				%>
				
						</form>
						<%-- <%
							for (Student student:list) { 
						%>
						<tr>
							<td><%=student.getId()%></td>
							<td><%=student.getName()%></td>
							<td><%=student.getAge()%></td>
							<td><%=student.getGender()%></td>
							<td>
								<a href="/Java823Web/student?method=toupdate&id=<%=student.getId()%>">修改</a>
							</td>
							<td>
								<a href="/Java823Web/student?method=deleteById&id=<%=student.getId()%>">删除</a>
							</td>
						</tr>
						
						<%
							}
						%>
						 --%>
								
					</table>
				</div>
				<!--右侧数据栏结束 -->
				</div>
			</div>
		<!--正文结束-->
		
		<script src="lib/jquery/jquery-1.11.1.js" type="text/javascript" charset="utf-8"></script>
		<script src="lib/js/bootstrap.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" src="lib/bootstrap-3.3.7-dist/js/bootstrap.js" ></script>
	</body>
</html>
